home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 8_8.lha / 8_8 / 8_8_op.c < prev    next >
Text File  |  1993-08-08  |  369b  |  21 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. nt randomchars::operator[](long offset)
  6.  
  7.    if (offset != curoffset)
  8. if (fseek(fp, offset, 0))
  9.     return -1;
  10.  
  11.    int c = getc(fp);
  12.    if (c == EOF)
  13. {
  14. curoffset = offset;
  15. return -1;
  16. }
  17.  
  18.    curoffset = offset + 1;
  19.    return c;
  20.  
  21.